package com.zbs.framework.dao.user.entity;


import com.zbs.framework.dao.role.entity.Role;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * 用户基本信息表
 */

@Entity
@Table(name = "user_comb_normal_acc")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class UserNormalAccComb {
    @Id
    private Long id;
    private String acctUuid;
    private String name; // 真实姓名
    private Character gender; // 性别
    private Date createTime; // 创建时间
    private Character userType; // 用户类型
    private String birthday; // 生日
    private String headImg;// 头像
    private String phone;
    private Integer enabled;
    private String username;// 账号
    private String pwd;// 密文密码
    @ManyToMany(fetch = FetchType.EAGER)
    @JoinTable(name="mnt_user_role",joinColumns={@JoinColumn(name="userId", referencedColumnName = "id")}
            ,inverseJoinColumns={@JoinColumn(name="roleId", referencedColumnName = "id")})
    private List<Role> roles;
}
